$(function() {
  /*var populationStructureChart = echarts.init(document.getElementById('population-structure-chart'));

  var populationStructureOption = {
    color: ["#f3a634", "#1f8bd7", "#eb5d4a"],
    series: [{
      name: '越界人数',
      type: 'pie',
      radius: ['50%', '96%'],
      center: ['50%', '50%'],
      data: [{
        value: 600,
        name: '户籍人口'
      }, {
        value: 400,
        name: '外来人口'
      }, {
        value: 100,
        name: '境外人员'
      }, ],
      label: {
        normal: {
          show: false
        }
      },
      labelLine: {
        normal: {
          show: false
        }
      },
      legendHoverLink: false,
      hoverAnimation: false,
      itemStyle: {
        emphasis: {
          shadowBlur: 10,
          shadowOffsetX: 0,
          shadowColor: 'rgba(0, 0, 0, 0.5)'
        }
      }
    }]
  };
  populationStructureChart.setOption(populationStructureOption);


  var agePeopleChart = echarts.init(document.getElementById('age-people-chart'));

  var agePeopleOption = {
    color: ["#f3a634", "#1f8bd7", "#eb5d4a"],
    legend: {
      show: false
    },
    grid: {
      left: '3%',
      right: '4%',
      bottom: '3%',

    },
    xAxis: [{
      type: 'category',
      data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
    }],
    yAxis: [{
      type: 'value'
    }],
    series: [{
        name: '年轻型',
        type: 'bar',
        stack: '人口',
        data: [120, 132, 101, 134, 90, 230, 210]
      },
      {
        name: '成年型',
        type: 'bar',
        stack: '人口',
        data: [220, 182, 191, 234, 290, 330, 310]
      },
      {
        name: '老年型',
        type: 'bar',
        stack: '人口',
        data: [150, 232, 201, 154, 190, 330, 410]
      }
    ]
  }

  agePeopleChart.setOption(agePeopleOption);*/

  $(".zhgl-map-tab li").on("click", function() {
    var liIndex = $(this).index();
    $(".info-header .info-header-container").hide();
    $(".info-header .info-header-container").eq(liIndex).show();
    $(".info-content .info-content-container").hide();
    $(".info-content .info-content-container").eq(liIndex).show();
  })


  $(".info-header-down").on("click", function() {
    $(".info-content").slideToggle(300);
  })

  $(".info-content-filter-result").on("click", function() {
    $(this).fadeOut(300, function() {
      $(".info-content-filter").fadeIn(300);
    })
    $(".check-detail").fadeOut(300);
  })
  $(".form-footer .confirm-btn").on("click", function() {
    $(".info-content-filter").fadeOut(300, function() {
      $(".info-content-filter-result").fadeIn(300);
      $(".check-detail").fadeIn(300);
    })
  })

  $(".check-detail").on("click", function() {
    $(".info-content .info-content-container").hide();
    $(".search-result-content").show();
  })

  $(".search-result-header .search-back").on("click", function() {
    $(".info-content .info-content-container").hide();
    $(".info-content-population").show();
  })


  $(".search-result-list li").on("click", function() {
    var newObj = {
      target: ".zhgl-map-gis",
      height: 100,
      width: 100,
      left: 560,
      top: 120
    }
    $(".search-result-list li").first().HESCGIS_Panel(newObj);
  })

  $(".zhgl-map-tool-tab div").on("click", function() {
    $(".zhgl-map-tool-tab div").removeClass("active");
    $(this).addClass("active");
  })

  $(".tool-drag-btn").dragging({
    move: 'y', //拖动方向，x y both
    randomPosition: false, //初始位置是否随机
  });

  $(".people-panel").dragging({
    move: 'both', //拖动方向，x y both
    randomPosition: false, //初始位置是否随机
    hander:'.zhgl-panel-header'
  });

  $(".record-panel").dragging({
    move: 'both', //拖动方向，x y both
    randomPosition: false, //初始位置是否随机
    hander:'.zhgl-panel-header'
  });

  $(".zhgl-panel-header .pull-right").on("click",function(){
     $(this).parents(".zhgl-panel-box").hide();
  })


})
